<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- 避免使用IE冲突 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <!-- 360切换到极速内核 -->
    <meta name="renderer" content="webkit">
    <!-- 手机搜索转码 -->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>视频</title>
    <link rel="stylesheet" href="static/css/common.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/video.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/class-pro.css" type="text/css"/>
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_333802_ypr9k5jwbv.css"/>
    <link rel="stylesheet" href="static/css/iconfont.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/jquery-page.css" type="text/css"/>
    <link rel="shortcut icon" href="static/images/logo.jpg" type="image/x-icon"/>
    <link rel="stylesheet" href="static/css/layui.css" type="text/css"/>
    <script type="text/javascript" src="static/js/vue.js"></script>
    <script type="text/javascript" src="static/js/axios.min.js"></script>
    <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.3.5/skins/default/aliplayer-min.css"/>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <style>
        .el-carousel__container{
            height: 420px;
        }
        .regisers{
            color: #2b9dff;
        }
        .regisers:hover{
            cursor: pointer;
            color: #155bff;
        }
        .el-menu--horizontal>.el-submenu.is-active .el-submenu__title{
            border: none;
            height: 80px;
            line-height: 80px;
        }
        .el-menu.el-menu--horizontal{
            border:none;
        }
        .tab{
            width: 80px;
            height: 40px;
            background-color: #F3F5F7;
            float: left;
            margin-right: 10px;
            margin-bottom: 10px;
            text-align: center;
            line-height: 40px;
            font-size: 14px;
            color: #8D8D8D;
        }
    </style>
</head>

<body>
<div id="app">

<!------------------------顶部导航----------------------------------->
<!------------------------顶部导航----------------------------------->
    <div class="header">
        <div class="header-box">
            <a href="#" class="logo"><img src="static/images/logo.jpg" width="119" height="70" alt="叮叮财税">
                <span> <img src="static/images/title.png"></span>
            </a>
            <ul id="header-nav">
                <li id="index"><a href="index.html">首页</a></li>
                <li id="course"><a href="study.html">课程</a></li>
                <li id="news"><a href="consult.html">资讯</a></li>
                <li id="download"><a href="download.html">下载</a></li>
                <li id="service"><a href="service.html">服务</a></li>
            </ul>
            <div class="login rt" id="user-info">
                <el-menu class="el-menu-demo" mode="horizontal" v-if="userPhone">
                    <el-submenu index="1">
                        <template slot="title">{{userPhone}}</template>
                        <el-menu-item index="" style="padding: 10px;width: 200px;height: 190px;position:relative;background: #fff">
                            <a href="home.html"  style="width: 100%;height: 100%;display: block;">
                                <div>{{userInfo.name}}{{userInfo.phone}}</div>
                                <div style="overflow: hidden;">
                                    <div class="tab">我的课程</div>
                                    <div class="tab">我的收藏</div>
                                    <div class="tab">个人中心</div>
                                    <div class="tab">咨询记录</div>
                                </div>
                            </a>
                            <div style="position:relative;z-index: 100;top: -34px;left: 90px;">
                                <el-button type="primary" size="small" @click="loginOut">安全退出</el-button>
                            </div>
                        </el-menu-item>
                    </el-submenu>
                </el-menu>
                <a href="javascript:;" class="ml-30 mr-30" id="loginBtn" @click="showLogin" v-if="!userPhone">
                    <i class="login-ico"></i>登录
                </a>

                <a href="javascript:;" id="logoutBtn" @click="showRegister" v-if="!userPhone">
                    <i class="regin-ico"></i>注册
                </a>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="clearBoth"></div>
    </div>
<!-- 弹框 -->
<el-dialog
        :title="title"
        :visible.sync="loginDialogVisible"
        :close-on-click-modal="false"
        width="400px"
        center>
    <div>
        <el-form :model="form" :rules="rules" ref="form" label-width="60px">
            <el-form-item label="手机号" prop="phone">
                <el-input  v-model="form.phone" placeholder="请输入手机号" style="width: 300px;"></el-input>
            </el-form-item>
            <el-form-item label="密码" prop="password">
                <el-input v-model="form.password" placeholder="请输入密码" style="width: 300px;"></el-input>
            </el-form-item>
        </el-form>
        <div style="text-align: right">
            <span @click="isLogin = false" v-if="isLogin" class="regisers">去注册</span>
        </div>
        <div style="text-align: right">
            <span @click="isLogin = true" v-if="!isLogin" class="regisers">去登录</span>
        </div>
    </div>
    <span slot="footer" class="dialog-footer"  v-if="isLogin">
            <el-button @click="loginDialogVisible = false">取 消</el-button>
            <el-button type="primary" :loading="loading" @click="submitCostomer('form')">{{loading?'登录中':'登录'}}</el-button>
        </span>
    <span slot="footer" class="dialog-footer"  v-if="!isLogin">
            <el-button @click="loginDialogVisible = false">取 消</el-button>
            <el-button type="primary" :loading="loading" @click="submitCostomer('form')">{{loading?'注册中':'注册'}}</el-button>
        </span>
</el-dialog>
<div class="video">
    <div class="video-box">
        <div class="video-left">
            <p class="kc-tit">
                <span><a href="study.html">全部课程</a></span>
                &nbsp;&nbsp;&gt;&nbsp;&nbsp;
                <span><a href="#">{{courseDetailData.title}}</a></span>
                <!--&nbsp;&nbsp;&gt;&nbsp;&nbsp;-->
                <!--<span class="current">金三“并库”已上线，税务稽查全面开启</span>-->
            </p>
            <div class="play" id="play">
                <!--<video autoplay="autoplay" style="width: 100%; height: 100%;" src="http://video.caishuib.com/68ba4bc1d1fb496ca5f5d29c32808202/e20aea998a9e49aeabf619a341999bcf-37665aa4e9056cdaa119e30142b19aaf-ld.mp4"></video>-->
                <video autoplay="autoplay" controls style="width: 100%; height: 100%;" :src="courseDetailData.video_url"></video>
            </div>
        </div>
        <!--------------------右侧------------------->
        <!--<div class="video-right">-->
            <!--<div class="v-tab">-->
                <!--<ul>-->
                    <!--<li class="cur"><a href="javascript:void(0)">课程目录</a></li>-->
                    <!--<li><a href="javascript:void(0)">老师介绍</a></li>-->
                    <!--<li><a href="javascript:void(0)">课程评论 </a></li>-->
                <!--</ul>-->
            <!--</div>-->

            <!--<div class="tabBox scroll_wrap">-->
                <!--&lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;右侧课程目录内容-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
                <!--<div class="catalogue tab">-->
                    <!--<ul>-->
                        <!--<li class="menu">-->
                            <!--<a href="javascript:void(0)" class="li-title01" style="height: 55px;overflow: hidden;">-->
                                <!--<i class="menu-icon menu-icon01"></i>-->
                                <!--<span>金三“并库”已上线，税务稽查全面开启</span>-->
                            <!--</a>-->
                            <!--<ul class="kc-menu-list">-->
                                <!--<li>-->
                                    <!--<a href="javascript:;"-->
                                       <!--onclick="toStudy('476079a9a3cde8515d7e784ef07ce5f4_4', '9c6af94582b04ea9a3f82c2481701fd6', '6c984ce43899489daec80f861fc707b7','00');">-->
                                        <!--<i class="player"></i>-->
                                        <!--&lt;!&ndash; <span class="fl">1</span> &ndash;&gt;-->
                                        <!--<span class="kcTit">01 金税三期并库，财务裸奔的终极时刻到了！</span>-->
                                        <!--<span class="kcTime">25:51</span>-->
                                    <!--</a>-->
                                <!--</li>-->
                                <!--<li>-->
                                    <!--<a href="javascript:;"-->
                                       <!--onclick="toStudy('476079a9a3b129c2ad2c0f2d963fdac8_4', 'ada08cb0d15c486a8340d6f1b9bd3231', '6c984ce43899489daec80f861fc707b7','00');">-->
                                        <!--<i class="player"></i>-->
                                        <!--&lt;!&ndash; <span class="fl">1</span> &ndash;&gt;-->
                                        <!--<span class="kcTit">02 “两套账”，你以为税务局不知道？</span>-->
                                        <!--<span class="kcTime">23:09</span>-->
                                    <!--</a>-->
                                <!--</li>-->
                                <!--<li>-->
                                    <!--<a href="javascript:;"-->
                                       <!--onclick="toStudy('476079a9a3037f5e4b3e277586148c1e_4', '037c7a45839f4e819c5e8c4c10c75309', '6c984ce43899489daec80f861fc707b7','00');">-->
                                        <!--<i class="player"></i>-->
                                        <!--&lt;!&ndash; <span class="fl">1</span> &ndash;&gt;-->
                                        <!--<span class="kcTit">03 关联交易别只顾看税负，看风险！</span>-->
                                        <!--<span class="kcTime">18:07</span>-->
                                    <!--</a>-->
                                <!--</li>-->
                                <!--<li>-->
                                    <!--<a href="javascript:;"-->
                                       <!--onclick="toStudy('476079a9a3a37dc689b369a195b07f0e_4', '5c73e7e80fbf4c3c998a7d4445defbb3', '6c984ce43899489daec80f861fc707b7','00');">-->
                                        <!--<i class="player"></i>-->
                                        <!--&lt;!&ndash; <span class="fl">1</span> &ndash;&gt;-->
                                        <!--<span class="kcTit">04 失控发票别轻视，这是颗雷！</span>-->
                                        <!--<span class="kcTime">12:00</span>-->
                                    <!--</a>-->
                                <!--</li>-->
                            <!--</ul>-->
                        <!--</li>-->
                    <!--</ul>-->
                <!--</div>&lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;右侧老师介绍内容-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
                <!--<div class="teacher-info tab">-->
                    <!--<div class="img">-->
                        <!--<a href="/lecturer/detail/a48215f4ed6246fda55e2bd5c143c994" class="a-box">-->
                            <!--<img src="https://assets.xiucai.com/assets/uploads/pic/2018/1228/1576a829-eb8c-1912-df6f-bde24c5f97f3.jpg"/>-->
                        <!--</a>-->
                    <!--</div>-->
                    <!--<div class="name">-->
                        <!--<span>何老师</span>-->
                        <!--<p>-->
                        <!--<p>-->
                            <!--神州九鼎（天津）企业管理咨询合伙企业高级合伙人，天津君辉律师事务所高级合伙人，从2014年起担任多家公司顾问工作，为企业的疑难财税问题提供筹划思路，帮助多家企业制定财税内控机制平台以及税务风险预防体系，指导多家企业灵活应对税务评估、稽查等事宜，专长于理解税务机关执法理念、税务风险关注点和处理涉税行为的法律程序，对企业预防、规避和化解税务风险的具体防范措施有独到的见解。从2015年起担任多家企业的内部培训工作，主要是大型集团公司增值税风险预防、所得税风险预防以及行业财税筹划方案以及落地等。是南开大学MPACC硕士，中国注册会计师，中国注册税务师，律师。</p></p>-->
                    <!--</div>-->
                <!--</div>-->
                <!--&lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;右侧课程评论-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
                <!--<div class="discuss tab">-->
                    <!--<ul class="evaluation-list evaluation-list01">-->
                        <!--<span style="color: #f0f0f0;">抱歉，该课程暂无评论信息！！！</span>-->
                    <!--</ul>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
    </div>
</div>
<!--------------------课程详细----------------------->
<div class="proBox">
    <div class="ltPro">
        <div class="classTab">
            <ul>
                <!-- class="cur" -->
                <li><a style="cursor: pointer;" id="evaId1" onclick="searchType('01')">课程详情 </a></li>
                <!--<li><a style="cursor: pointer;" id="evaId3" onclick="searchType('03')">课程评论 </a></li>-->
                <!--<li><a style="cursor: pointer;" id="evaId4" onclick="searchType('04')">课件下载 </a></li>-->
            </ul>
        </div>
        <div class="content" style="padding: 10px;" v-html="courseDetailData.details"></div>
    </div>

    <!--<div class="rtPro">-->
    <!--<div class="rtProBox">-->
    <!--<div class="teacher">-->
    <!--<h5>主讲老师</h5>-->

    <!--<a href="/lecturer/detail/a48215f4ed6246fda55e2bd5c143c994"  class="a-box">-->
    <!--<div class="touxiang">-->
    <!--<img src="https://assets.xiucai.com/assets/uploads/pic/2018/1228/1576a829-eb8c-1912-df6f-bde24c5f97f3.jpg"/>-->
    <!--</div>-->
    <!--</a>-->
    <!--<span class="name">何老师</span>-->
    <!--<p><p>神州九鼎（天津）企业管理咨询合伙企业高级合伙人，天津君辉律师事务所高级合伙人，从2014年起担任多家公司顾问工作，为企业的疑难财税问题提供筹划思路，帮助多家企业制定财税内控机制平台以及税务风险预防体系，指导多家企业灵活应对税务评估、稽查等事宜，专长于理解税务机关执法理念、税务风险关注点和处理涉税行为的法律程序，对企业预防、规避和化解税务风险的具体防范措施有独到的见解。从2015年起担任多家企业的内部培训工作，主要是大型集团公司增值税风险预防、所得税风险预防以及行业财税筹划方案以及落地等。是南开大学MPACC硕士，中国注册会计师，中国注册税务师，律师。</p></p>-->
    <!--</div>-->
    <!--</div>-->
    <!--&lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;讲师的相关课程-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
    <!--&lt;!&ndash; 课程详情页面右侧讲师信息下方——讲师的其它推荐课程 &ndash;&gt;-->
    <!--&lt;!&ndash;-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;讲师的其它推荐课程-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
    <!--<div class="rtProBox">-->
    <!--<div class="teacher">-->
    <!--<h5>相关推荐</h5>-->
    <!--<div class="class" >-->
    <!--<a href="/course/detail/97ec819ed24e43a1b84b84f0b5409ece"  class="a-box">-->
    <!--<div class="img-box">-->
    <!--<img src="http://img04.4008990000.net/upload/images/20190121/1548055588153093258.jpg">-->
    <!--</div>-->
    <!--<h4 class="info">-->
    <!--<span class="p-title">“年终奖”优惠政策在2019年如何应用</span>-->
    <!--</h4>-->
    <!--<div class="tips">-->
    <!--<span>技能精进</span>-->
    <!--<em>|</em>-->
    <!--<span>582人已学习</span>-->
    <!--</div>-->
    <!--<div class="price">-->
    <!--<span class="state">免费课程</span></div>-->
    <!--</a>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
</div>
<!--------------------底部------------------->
<div class="footer">
    <div class="footer-box">
        <div class="service-nav lf">
            <dl>
                <dt>帮助中心</dt>
                <dd>
                    <a href="/article/website/detail/76c45ac5c7f54d458ab10e8536860acc" target="_blank">如何注册</a>
                    <a href="/article/website/detail/954f73e81fa44e658c86313bcb0d683a" target="_blank">如何登录</a>
                    <a href="/article/website/detail/7c5e2474ee9340f688a74f95caeef05f" target="_blank">如何观看</a>
                </dd>
            </dl>
            <dl>
                <dt>服务支持</dt>
                <dd>
                    <a href="/article/website/detail/57577942c54b40beac72bbc6fc18986e" target="_blank">在线咨询</a>
                    <a href="/article/website/detail/afff080e65f44892ad6fae4fea56f8f9" target="_blank">联系我们</a>
                    <a href="/article/website/detail/7fc5e823ad724afda9d43f2eccdeb029" target="_blank">服务网点</a>
                </dd>
            </dl>
            <dl>
                <dt>关于叮叮财税</dt>
                <dd>
                    <a href="/article/website/detail/87099e60d03f451a9884d7e80fecdb7d" target="_blank">品牌介绍</a>
                    <a href="/article/website/detail/223ed27752cd4577a6e63eafbb0db119" target="_blank">发展历程</a>
                    <a href="/article/website/detail/92bd991d6f9b4c6c94cc98e237d613fd" target="_blank">产品与服务</a>
                </dd>
            </dl>
        </div>

        <div class="help rt">
            <div class="help-phone">
                <i class="d-icon"></i>
                客服热线：<strong>400-899-0000</strong>
            </div>
            <div class="help-phone">
                <i class="d-icon"></i>
                客服热线：<strong>028-83227755</strong>
            </div>
            <div class="huiyuan">
                <i class="h-icon"></i>
                会员专线：<strong>028-84551133</strong>
            </div>
            <div class="online">
                <a href="https://xiaojuzi.shujet.com/visitor/chat" target="_blank">
                    <i class="xinxi"></i>
                    在线咨询
                </a>
            </div>
        </div>
        <div class="barcode rt">
            <img src="static/images/contact.png"/>
            <p>关注叮叮财税</p>
        </div>
    </div>
    <div class="footer-copy">
        <div class="a-box">
            <a href="">隐私条款</a> |
            <a href="">网站地图</a> |
            <a href="">版权声明</a>
        </div>
        <p>&copy;20179</p>
    </div>
</div>

<script type="text/javascript">
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?a71c3d484b2419b0d94468789f7f49e1";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
<script type="text/javascript" src="http://trace.shujet.com/trace.js"></script>

<script type="text/javascript" src="static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src='https://player.polyv.net/script/polyvplayer.min.js'></script>
<script type="text/javascript" src="static/js/jquery.page.js"></script>
<script language="javascript" src="static/js/layer.js"></script>
<script type="text/javascript" src="static/js/layui.js"></script>
<script type="text/javascript" src="static/js/caishuib.js"></script>
<script type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.3.5/aliplayer-min.js"></script>
<script type="text/javascript">

    $(function () {
        navClassSelect("#header-nav", "course", "current");
        var z = 0;
        $(".ltPro .select").eq(z).show().siblings(".select").hide();
        $(".classTab li").eq(z).addClass("cur");
        $(".v-tab li").click(function () {
            var z = $(this).index();
            $(this).addClass("cur").siblings().removeClass("cur");
            $(".tabBox .tab").eq(z).show().siblings(".tab").hide();
        })
        $(".ltPro .select").first().show();
        $(".classTab li").click(function () {
            var z = $(this).index();
            $(this).addClass("cur").siblings().removeClass("cur");
            $(".ltPro .select").eq(z).show().siblings(".select").hide();
        })
        //课程目录点击展开隐藏
        $(".menu a").click(function () {
            if ($(this).nextAll(".kc-menu-list").is(":hidden")) {
                $(".kc-menu-list").hide();
                $(this).nextAll(".kc-menu-list").show();
            } else {
                $(".kc-menu-list").hide();
                $(this).nextAll(".kc-menu-list").hide();
            }
        });

        //阿里云播放器暂停
//        $(".prism-play-btn").click(function(){
//            addPlayRecord(caishuib.timePoint);
//        });
//        $(".prism-big-play-btn").click(function(){
//            addPlayRecord(caishuib.timePoint);
//        });

    });

    var flg = true;

    //分页器
    function splitPage(pageCount, current) {
        flg = false;
        $(".tcdPageCode").createPage({
            pageCount: pageCount,
            current: current,
            backFn: function (pn) {
                loadEvaluation(courseId, pn)
            }
        });
    }

    var resflg = true;

    //分页器
    function resSplitPage(pageCount, current) {
        resflg = false;
        $(".restcdPageCode").createPage({
            pageCount: pageCount,
            current: current,
            backFn: function (pn) {
                loadResourceRelevace(courseId, pn, '00');
            }
        });
    }

    var courseId = '6c984ce43899489daec80f861fc707b7';//课程id


    //切换显示选项
    function searchType(type) {
        if (type == "01") {

        } else if (type == "03") {
            loadEvaluation(courseId, '1');
        }
        if (type == "04") {
            loadResourceRelevace(courseId, '1', '01');
        }
    }





</script>

</div>
</body>
<script type="text/javascript">
    var validatePass = (rule, value, callback) => {
        if (value === '') {
            callback(new Error('请输入密码'));
        } else {
            var r = /^[^\u4e00-\u9fa5]+$/
            if(!r.test(value)){
                callback(new Error('密码不能为中文!'));
            }
            if (value.length < 6 ) {
                callback(new Error('密码长度在 6 到 18 个字符!'));
            }
            callback();
        }
    };
    var phoneValid = (rule, value, callback) => {
        let phoneReg = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/
        if (!value) {
            callback(new Error('请输入手机号码'))
        }
        if (!phoneReg.test(value)) {
            callback(new Error('请输入正确的手机号码'))
        }
        callback()
    };
    new Vue({
        el: '#app',
        data: {
            title:'',
            form: {
                phone:'',
                password:''
            },
            rules: {
                phone: [
                    { validator: phoneValid, trigger: 'change' }
                ],
                password: [
                    { validator: validatePass, trigger: 'change' }
                ]
            },
            isLogin:true,
            loading:false,
            loginDialogVisible:false,
            courseDetailData: [],
            contentData: [],
            headData: [],
            shareData: [],
            shenData: [],
            caishuiData: [],
            token: '',
            isToLogin: false,
            phone: '',
            password: '',
            errText: '',
            userPhone:'',
            userInfo:{},
            courseDetailHttp: 'http://xiaopengbest.cn/api/user/playVideo/'

        },
        watch: {
            loginDialogVisible:function (val) {
                if (!val) {
                    Object.keys(this.form).forEach(key => this.form[key] = '');
                    this.$refs['form'].resetFields();
                }
            },
            isLogin:function (val) {
                if (val) {
                    this.title='登录';
                } else{
                    this.title='注册';
                }
            }
        },
        created() {
            this.courseDetailHttp = this.courseDetailHttp + this.GetRequest('id');
            this.token = localStorage.getItem('token');
            this.token =(this.token.replace('"',''));
            this.userPhone = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')).phone:'';
            this.userInfo = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')):'';
            this.getCourseDetailList();
        },
        mounted() {
        },
        methods: {
            loginOut() {
                localStorage.clear();
                window.location.href = 'http://xiaopengbest.cn/index.html';
            },
            showLogin() {
                this.title='登录';
                this.isLogin = true;
                this.loginDialogVisible = true;
            },
            showRegister() {
                this.title='注册';
                this.isLogin = false;
                this.loginDialogVisible = true;
            },
            submitCostomer(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        if (this.isLogin){
                            this.toLogin();
                        } else {
                            this.toRegister();
                        }
                    } else {
                        return false;
                    }
                });
            },
            toLogin() {
                this.loading = true;
                axios.post(this.loginHttp, {
                    phone: this.form.phone,
                    password:this.form.password
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.loading = false;
                        this.$message({
                            type:'success',
                            message:'登录成功',
                            duration:1000
                        });
                        this.loginDialogVisible = false;
                        this.userPhone = res.data.data.phone;
                        localStorage.setItem('userInfo', JSON.stringify(res.data.data));
                        localStorage.setItem('token', JSON.stringify(res.data.data.api_token));
                    }
                }).catch((err)=> {
                    this.loading = false;
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
            toRegister() {
                this.loading = true;
                axios.post(this.registerHttp, {
                    phone: this.form.phone,
                    password:this.form.password
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.loading = false;
                        this.$message({
                            type:'success',
                            message:'注册成功,去登陆',
                            duration:1000
                        });
                        this.isLogin = true;
                    }
                }).catch((err)=> {
                    this.loading = false;
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
            GetRequest(value) {
                let url = decodeURI(location.search);
                let object = {};
                if(url.indexOf("?") != -1)
                {
                    let str = url.substr(1);
                    let strs = str.split("&");
                    for(let i = 0; i < strs.length; i ++)
                    {
                        object[strs[i].split("=")[0]]=strs[i].split("=")[1]
                    }
                }
                return object[value];
            },
            getCourseDetailList() {
                const self = this;
                axios.get(this.courseDetailHttp, {
                        headers: {
                            "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
                            'Authorization': 'Bearer ' + this.token,
                        }
                    }
                )
                    .then(function (res) {
                        self.courseDetailData = res.data.data;
                    }).catch(function (res) {
                    console.log(res);
                });
            }
        }
    });
</script>
</html>
